//Source file: D:\\WTK104\\apps\\Toddtris\\src\\com\\toddsoft\\toddtris\\control\\ToddtrisController.java

package com.toddsoft.toddtris.control;

import com.toddsoft.toddtris.model.Well;

public abstract class ToddtrisController {
    protected Well well;
    
    /**
     * @param well
     */
    protected ToddtrisController(Well well) {
        this.well = well;     
    }
    
    public boolean rotate() {
        return this.getHandler().rotate(well);     
    }
    
    public boolean antirotate() {
        return this.getHandler().antirotate(well);     
    }
    
    public boolean left() {
        return this.getHandler().left(well);     
    }
    
    public boolean right() {
        return this.getHandler().right(well);     
    }
    
    public boolean down() {
        return this.getHandler().down(well);     
    }
    
    public boolean drop() {
        return this.getHandler().drop(well);     
    }
    
    public void restart() {
        this.getHandler().restart(well);     
    }
    
    public void togglePause() {
        this.getHandler().togglePause(well);     
    }
    
    /**
     * Method should return an appropriate ActionHandler
     * based on the well's current state
     * @return ActionHandler
     */
    protected abstract ActionHandler getHandler();
}
